import i18n from '@/lang'
import Vue from 'vue'
export const allApplyColumns = [
  {
    title: i18n.t('applycontent'),
    dataIndex: 'instanceName',
    width: 230,
    key: 'instanceName',
    scopedSlots: { customRender: 'applycontent' }
  },
  {
    title: i18n.t('forms')+i18n.t('status'),
    dataIndex: 'instanceStatus',
    key: 'instanceStatus',
    width: 100,
    scopedSlots: { customRender: 'instanceStatus' }
  },
  {
    title: i18n.t('businessType'),
    dataIndex: 'businessName',
    key: 'businessType',
    width: 100,
    scopedSlots: { customRender: 'businessType' }
  },
  {
    title: i18n.t('withdrawType'),
    dataIndex: 'cancelType',
    key: 'cancelType',
    width: 100,
    scopedSlots: { customRender: 'cancelType' }
  },
  {
    title: i18n.t('currentAuditNode'),
    dataIndex: 'auditNode',
    key: 'auditNode',
    width: 110,
  },
  {
    title: i18n.t('auditOpinion'),
    dataIndex: 'auditComment',
    key: 'auditComment',
    width: 90,
    scopedSlots: { customRender: 'auditComment' },
  },
  {
    title: i18n.t('reviewDoneTime'),
    dataIndex: 'endTime',
    key: 'endTime',
    width: 150,
    scopedSlots: { customRender: 'endTime' },
    sorter: true

  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    key: 'createTime',
    width: 150,
    scopedSlots: { customRender: 'createTime' },
    sorter: true
  },
  {
    title: i18n.t('operation'),
    key: 'operation',
    width: 285,
    fixed: 'right',
    scopedSlots: { customRender: 'operation' }
  }
]
export const underReviewTbColumns = [
  {
    title: i18n.t('applycontent'),
    dataIndex: 'instanceName',
    key: 'instanceName',
    width: 280,
    scopedSlots: { customRender: 'instanceName' }
  },
  {
    title: i18n.t('forms')+i18n.t('status'),
    dataIndex: 'instanceStatus',
    key: 'instanceStatus',
    width: 100,
    scopedSlots: { customRender: 'instanceStatus' }
  },
  {
    title: i18n.t('businessType'),
    dataIndex: 'businessName',
    key: 'businessName',
    width: 100,
    scopedSlots: { customRender: 'businessName' }
  },
  {
    title: i18n.t('withdrawType'),
    dataIndex: 'cancelType',
    key: 'cancelType',
    width: 100,
    scopedSlots: { customRender: 'cancelType' }
  },
  {
    title: i18n.t('currentAuditNode'),
    dataIndex: 'auditNode',
    key: 'auditNode',
    width: 110,
  },
  {
    title: i18n.t('auditOpinion'),
    dataIndex: 'auditComment',
    key: 'auditComment',
    width: 90,
    scopedSlots: { customRender: 'auditComment' },
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    key: 'createTime',
    width: 190,
    scopedSlots: { customRender: 'createTime' },
    sorter: true
  },
  {
    title: i18n.t('operation'),
    width: 290,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export const formsStatusArr = [
  {
    value: 10,
    name: i18n.t('wjjgz')
  },
  {
    value: 20,
    name: i18n.t('wjjgsb')
  },
  {
    value: 30,
    name: i18n.t('dfqsp')
  },
  {
    value: 80,
    name: i18n.t('fqspsb')
  },
  {
    value: 40,
    name: i18n.t('reviewing')
  },
  {
    value: 50,
    name: i18n.t('passed')
  },
  {
    value: 60,
    name: i18n.t('rejected')
  },
  {
    value: 70,
    name: i18n.t('canceled2')
  }
]
export const degreeOfUrgencyEnumArr = [
  { value: 0, name: '一般' },
  { value: 1, name: '紧急' },

]
export const passOrNot = [
  { value: '1', name: '通过' },
  { value: '2', name: '未通过' }
]
export const stateSummaryEnumArr = [
  { value: '1', name: '通过' },
  { value: '2', name: '带风险通过' },
  { value: '3', name: '未通过' }
]
export const softwareChangeColumns = [
  {
    title: i18n.t('softwareNumber'),
    dataIndex: 'serialNo',
    width:80,
    align: 'center',
   customRender:(text,record,index)=>`${index+1}`
  },
  {
    title: i18n.t('beforeChange'),
    dataIndex: 'changeBefore',
    align: 'center',
    scopedSlots: { customRender: 'beforeChange' }
  },
  {
    title: i18n.t('afterChange'),
    dataIndex: 'inflectContent',
    align: 'center',
    scopedSlots: { customRender: 'afterChange' }
  },
  {
    title: i18n.t('functionalPrinciple'),
    dataIndex: 'function',
    align: 'center',
    scopedSlots: { customRender: 'functionalPrinciple' }
  },
  {
    title: i18n.t('influence'),
    dataIndex: 'affect',
    align: 'center',
    scopedSlots: { customRender: 'influence' }
  },
  {
    title: i18n.t('changeOfPurpose'),
    dataIndex: 'purpose',
    align: 'center',
    scopedSlots: { customRender: 'changeOfPurpose' }
  },
]
export const passedTbColumns = [
  {
    title: i18n.t('applycontent'),
    dataIndex: 'instanceName',
    width: 280,
    key: 'instanceName',
    scopedSlots: { customRender: 'instanceName' }
  },
  {
    title: i18n.t('forms')+i18n.t('status'),
    dataIndex: 'instanceStatus',
    key: 'instanceStatus',
    width: 100,
    scopedSlots: { customRender: 'instanceStatus' }
  },
  {
    title: i18n.t('businessType'),
    dataIndex: 'businessName',
    key: 'businessName',
    width: 100,
    scopedSlots: { customRender: 'businessName' }
  },
  {
    title: i18n.t('withdrawType'),
    dataIndex: 'cancelType',
    width: 100,
    key: 'cancelType',
    scopedSlots: { customRender: 'cancelType' }
  },
  {
    title: i18n.t('currentAuditNode'),
    dataIndex: 'auditNode',
    key: 'auditNode',
    width: 110,
  },
  {
    title: i18n.t('auditOpinion'),
    dataIndex: 'auditComment',
    key: 'auditComment',
    width: 90,
    scopedSlots: { customRender: 'auditComment' },
  },
  {
    title: i18n.t('reviewDoneTime'),
    dataIndex: 'endTime',
    width: 190,
    key: 'endTime',
    scopedSlots: { customRender: 'endTime' },
    sorter: true
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    width: 190,
    key: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    sorter: true
  },
  {
    title: i18n.t('operation'),
    width: 260,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export const rejectedTbColumns = [
  {
    title: i18n.t('applycontent'),
    dataIndex: 'instanceName',
    width: 280,
    key: 'instanceName',
    scopedSlots: { customRender: 'instanceName' }
  },
  {
    title: i18n.t('forms')+i18n.t('status'),
    dataIndex: 'instanceStatus',
    key: 'instanceStatus',
    width: 100,
    scopedSlots: { customRender: 'instanceStatus' }
  },
  {
    title: i18n.t('businessType'),
    dataIndex: 'businessName',
    width: 100,
    key: 'businessName',
    scopedSlots: { customRender: 'businessName' }
  },
  {
    title: i18n.t('withdrawType'),
    dataIndex: 'cancelType',
    width: 100,
    key: 'cancelType',
    scopedSlots: { customRender: 'cancelType' }
  },
  {
    title: i18n.t('currentAuditNode'),
    dataIndex: 'auditNode',
    key: 'auditNode',
    width: 110,
    scopedSlots: { customRender: 'auditNode' },
  },
  {
    title: i18n.t('auditOpinion'),
    dataIndex: 'auditComment',
    key: 'auditComment',
    width: 90,
    scopedSlots: { customRender: 'auditComment' },
  },
  {
    title: i18n.t('reviewDoneTime'),
    dataIndex: 'endTime',
    width: 190,
    key: 'endTime',
    scopedSlots: { customRender: 'endTime' },
    sorter: true
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    width: 190,
    key: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    sorter: true
  },
  {
    title: i18n.t('operation'),
    width: 285,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export const abolishedTbColumns = [
  {
    title: i18n.t('applycontent'),
    dataIndex: 'instanceName',
    width: 280,
    key: 'instanceName',
    scopedSlots: { customRender: 'instanceName' }
  },
  {
    title: i18n.t('forms')+i18n.t('status'),
    dataIndex: 'instanceStatus',
    key: 'instanceStatus',
    width: 100,
    scopedSlots: { customRender: 'instanceStatus' }
  },
  {
    title: i18n.t('businessType'),
    dataIndex: 'businessName',
    width: 100,
    key: 'businessName',
    scopedSlots: { customRender: 'businessName' }
  },
  {
    title: i18n.t('withdrawType'),
    dataIndex: 'cancelType',
    width: 100,
    key: 'cancelType',
    scopedSlots: { customRender: 'cancelType' }
  },
  {
    title: i18n.t('currentAuditNode'),
    dataIndex: 'auditNode',
    key: 'auditNode',
    width: 110,
  },
  {
    title: i18n.t('auditOpinion'),
    dataIndex: 'auditComment',
    key: 'auditComment',
    width: 90,
    scopedSlots: { customRender: 'auditComment' },
  },
  {
    title: i18n.t('reviewDoneTime'),
    dataIndex: 'endTime',
    width: 190,
    key: 'endTime',
    scopedSlots: { customRender: 'endTime' },
    sorter: true
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    width: 190,
    key: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    sorter: true
  },
  {
    title: i18n.t('operation'),
    width: 120,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export const canceledTbColumns = [
  {
    title: i18n.t('applycontent'),
    dataIndex: 'instanceName',
    width: 280,
    key: 'instanceName',
    scopedSlots: { customRender: 'instanceName' }
  },
  {
    title: i18n.t('forms')+i18n.t('status'),
    dataIndex: 'instanceStatus',
    key: 'instanceStatus',
    width: 100,
    scopedSlots: { customRender: 'instanceStatus' }
  },
  {
    title: i18n.t('businessType'),
    dataIndex: 'businessName',
    width: 100,
    key: 'businessName',
    scopedSlots: { customRender: 'businessName' }
  },
  {
    title: i18n.t('withdrawType'),
    dataIndex: 'cancelType',
    width: 100,
    key: 'cancelType',
    scopedSlots: { customRender: 'cancelType' }
  },
  {
    title: i18n.t('currentAuditNode'),
    dataIndex: 'auditNode',
    key: 'auditNode',
    width: 110,
  },
  {
    title: i18n.t('auditOpinion'),
    dataIndex: 'auditComment',
    key: 'auditComment',
    width: 90,
    scopedSlots: { customRender: 'auditComment' },
  },
  {
    title: i18n.t('timeofCancel'),
    dataIndex: 'endTime',
    width: 160,
    key: 'endTime',
    scopedSlots: { customRender: 'endTime' },
    sorter: true
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    width: 160,
    key: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    sorter: true
  },
  {
    title: i18n.t('operation'),
    width: 260,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export const statusEnumArr = [
  { value: 10, name: i18n.t('underReview') },
  { value: 20, name: i18n.t('passed') },
  { value: 30, name: i18n.t('rejected') },
  { value: 40, name: i18n.t('canceled2') },
  { value: 50, name: i18n.t('synchronFailure') },
  { value: 60, name: i18n.t('abolished') },
  { value: 70, name: i18n.t('onshelfed') },
  { value: 80, name: i18n.t('offshelfed') },
  { value: 90, name: i18n.t('requestTimeout') },
  { value: 100, name: i18n.t('formException') },
  { value: 110, name: i18n.t('InitAuditFailed') }
]
export const yesOrNoEnumArr = [
  { value: 1, name: i18n.t('yes') },
  { value: 0, name: i18n.t('no') }
]
export const yesOrNoEnumArr10 = [
  { value: 1, name: i18n.t('yes') },
  { value: 0, name: i18n.t('no') }
]
export const yesOrNoEnumArr12 = [
  { value: 1, name: i18n.t('usersj') },
  { value: 2, name: i18n.t('zdsj') }
]
export const ecuTableColumns = [
  // {
  //   title: i18n.t('formsId'),
  //   dataIndex: 'formsId',
  //   key: 'formsId',
  //   scopedSlots: { customRender: 'formsId' }
  // },
  {
    title: i18n.t('ecuName'),
    dataIndex: 'name',
    key: 'name1',
    scopedSlots: { customRender: 'name1' }
  },
  {
    title: i18n.t('partNumber'),
    dataIndex: 'name2',
    key: 'name2',
    scopedSlots: { customRender: 'name2' }
  },
  {
    title: i18n.t('softwareCoding'),
    dataIndex: 'softwareCode',
    key: 'softwareCode',
    scopedSlots: { customRender: 'softwareCode' }
  },
  {
    title: i18n.t('versionType'),
    dataIndex: 'version.versionType',
    key: 'version.versionType',
    customRender: (text, record, index) => {
      return Vue.$store.getters.getDictCodeObj('versionTypeDictCode')[text] || text;
    },
  },
  {
    title: i18n.t('ecuVersion'),
    dataIndex: 'name3',
    key: 'name3',
    scopedSlots: { customRender: 'name3' }
  },
  {
    title: i18n.t('releaseNote'),
    dataIndex: 'name4',
    key: 'name4',
    scopedSlots: { customRender: 'name4' }
  },
  {
    title: i18n.t('configFileVersion'),
    dataIndex: 'name5',
    key: 'name5',
    scopedSlots: { customRender: 'name5' }
  },
  {
    dataIndex: 'name6',
    key: 'name6',
    slots: { title: 'customTitle' },
    scopedSlots: { customRender: 'name6' }
  },
  // {
  //   slots: { title: 'isRollback' },
  //   dataIndex: 'isRollback',
  //   key: 'isRollback',
  //   scopedSlots: { customRender: 'isRollback' }
  // },
  {
    slots: { title: 'updateOrder' },
    dataIndex: 'updateOrder',
    key: 'updateOrder',
    scopedSlots: { customRender: 'updateOrder' }
  },

  // {
  //   title: i18n.t('engineerAcademy'),
  //   dataIndex: 'engineerAcademy',
  //   key: 'engineerAcademy',
  //   scopedSlots: { customRender: 'engineerAcademy' }
  // }
]
export const gcyAuditStrategyTableColumns = [
  {
    title: i18n.t('strategyName'),
    dataIndex: 'strategyName',
    key: 'strategyName',
    scopedSlots: { customRender: 'strategyName' }
  },
  {
    title: i18n.t('createApply'),
    dataIndex: 'createApply',
    key: 'createApply',
    scopedSlots: { customRender: 'createApply' }
  },
  {
    title: i18n.t('returnResult'),
    dataIndex: 'returnResult',
    key: 'returnResult',
    scopedSlots: { customRender: 'returnResult' }
  },
  {
    title: i18n.t('statusNote'),
    dataIndex: 'statusNote',
    key: 'statusNote',
    scopedSlots: { customRender: 'statusNote' }
  }
]
export const taskMsgTableColumns = [
  {
    title: i18n.t('batchName'),
    dataIndex: 'batchName',
    key: 'batchName',
    scopedSlots: { customRender: 'batchName' }
  },
  {
    title: i18n.t('pch'),
    dataIndex: 'batchNo',
    key: 'batchNo',
    scopedSlots: { customRender: 'batchNo' }
  },
  {
    title: i18n.t('startTime'),
    dataIndex: 'startTime',
    key: 'startTime',
    scopedSlots: { customRender: 'startTime' }
  },
  {
    title: i18n.t('endTime'),
    dataIndex: 'endTime',
    key: 'endTime',
    scopedSlots: { customRender: 'endTime' }
  },
  {
    title: i18n.t('carTotal'),
    dataIndex: 'carTotal',
    key: 'carTotal',
    scopedSlots: { customRender: 'carTotal' }
  },
  {
    title: i18n.t('vinListDetail'),
    dataIndex: 'vinListDetail',
    key: 'vinListDetail',
    scopedSlots: { customRender: 'vinListDetail' }
  }
]
export const cancelTypeEnumArr = [{ value: 10, name: i18n.t('force') }, { value: 20, name: i18n.t('nonforce') }]
export const serviceTableColumns = [
  {
    title: i18n.t('serviceCode'),
    dataIndex: 'serviceCode',
    key: 'serviceCode'
  },
  {
    title: i18n.t('serviceName'),
    dataIndex: 'serviceName',
    key: 'serviceName'
  },
  // {
  //   title: i18n.t('presetOrNot'),
  //   dataIndex: 'enableState',
  //   key: 'enableState',
  //   scopedSlots: { customRender: 'enableState' }
  // },
  {
    title: i18n.t('销售方式'),
    dataIndex: 'saleState',
    key: 'saleState',
    scopedSlots: { customRender: 'saleState' }
  },
  {
    title: i18n.t('是否需激活'),
    dataIndex: 'activeState',
    key: 'activeState',
    scopedSlots: { customRender: 'activeState' }
  },
  {
    title: i18n.t('是否需学习'),
    dataIndex: 'needStudy',
    key: 'needStudy',
    scopedSlots: { customRender: 'needStudy' }
  },
  // {
  //   title: i18n.t('versionDepend'),
  //   dataIndex: 'serviceId',
  //   key: 'serviceId',
  //   scopedSlots: { customRender: 'serviceId' }
  // }
]
export const reviewProcessColumns = [
  {
    title: i18n.t('nodeCode'),
    dataIndex: 'name1',
    key: 'name1',
    scopedSlots: { customRender: 'name1' }
  },
  {
    title: i18n.t('nodeName'),
    dataIndex: 'name2',
    key: 'name2',
    scopedSlots: { customRender: 'name2' }
  },
  {
    title: i18n.t('approver'),
    dataIndex: 'name3',
    key: 'name3',
    scopedSlots: { customRender: 'name3' }
  },
  {
    title: i18n.t('urgeTimes'),
    dataIndex: 'name4',
    key: 'name4',
    scopedSlots: { customRender: 'name4' }
  },
  {
    title: i18n.t('operationResult'),
    dataIndex: 'name5',
    key: 'name5',
    scopedSlots: { customRender: 'name5' }
  },
  {
    title: i18n.t('attachment'),
    dataIndex: 'name6',
    key: 'name6',
    scopedSlots: { customRender: 'name6' }
  },
  {
    title: i18n.t('verifyTime'),
    dataIndex: 'name7',
    key: 'name7',
    scopedSlots: { customRender: 'name7' }
  },
  {
    title: i18n.t('reviewComments'),
    dataIndex: 'name8',
    key: 'name8',
    scopedSlots: { customRender: 'name8' }
  }
]
export const initFormDataStrategy = {
  strategyVo: {
    id: '',
    conditionStrategyId: '',
    type: undefined,
    name: '',
    remark: '',
    modelId: '',
    vehicleVersionId: '',
    brandName: '',
    modelName: '',
    modelCode: '',
    trimLevel: '',
    vehicleVersionName: '',
    enabled: undefined,
    status: undefined,
    conditionStrategyName: '',
    ecuCount: undefined
  },
  conditionStrategyVo: {
    id: '',
    conditionStrategyId: '',
    type: undefined,
    name: '',
    remark: '',
    enabled: undefined,
    status: undefined,
    items: []
  },
  instanceResponse: {
    startUserName: '',
    definitionName: '',
    cancelType: '',
    instanceStatus: undefined,
    businessKey: '',
    variables: {},
    businessCode: '',
    instanceName: '',
    businessName: '',
    tasks: [
      {
        taskId: '',
        taskName: '',
        assignee: '',
        candidateType: '',
        candidatesName: '',
        urgeTimes: undefined,
        taskStatus: undefined,
        taskStatusName: '',
        taskResult: undefined
      }
    ],
    viewer: {
      finishedTaskSet: [],
      finishedSequenceFlowSet: [],
      unfinishedTaskSet: [],
      rejectedTaskSet: []
    },
    bpmnXml: ''
  },
  taskUpgradeStatisticsVo: {
    totalVehicle: undefined,
    successVehicle: undefined,
    failVehicle: undefined,
    notStartVehicle: undefined,
    notCompleteVehicle: undefined,
    runningVehicle: undefined,
    pausedVehicle: undefined
  },
  vehicleVersionVo: {
    id: '',
    modelId: '',
    model: {
      id: '',
      brandId: '',
      brandName: '',
      name: '',
      code: '',
      trimLevel: ''
    },
    name: '',
    code: '',
    enabled: undefined,
    approved: undefined,
    ecuVersions: [
      {
        id: '',
        vehicleVersionId: '',
        ecuId: '',
        ecuModuleId: '',
        softwareCode: '',
        versionId: '',
        groupRollback: undefined,
        ecu: {
          id: '',
          name: '',
          ecuModuleId: '',
          ecuDid: '',
          ecuDiaId: '',
          softwareCode: '',
          configSoftwareCode: '',
          ecuConfigDid: '',
          platform: '',
          encryptType: undefined,
          ecuReprogramType: '',
          ecuReprogramWay: '',
          ecuUpdateStyle: '',
          ecuIp: '',
          ecuPort: '',
          checkConfig: undefined
        },
        version: {
          id: '',
          name: '',
          code: '',
          softwareCode: '',
          configSoftwareCode: ''
        }
      }
    ]
  }
}
